﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ProformaItem.ascx.cs" 
Inherits="UILGestion.VentaAdmin.Proforma.ProformaItem" %>
 <%@ Register src="../ProyectoPanel.ascx" tagname="ProyectoPanel" tagprefix="uc4" %>
  <%@ Register assembly="WebLib" namespace="WebLib" tagprefix="lib" %>
 <%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>
 <input id="internalID" type="hidden" runat="server" />
  <input id="idColeccion" type="hidden" runat="server" />
<%--  <asp:Button ID="addUIBTN" runat="server" Text="Buscar ..."   OnClick="AddGraficaItem"
                                            CssClass="ms-crm-List-Header"  /> --%>



   <asp:GridView ID="itemGridView" runat="server" DataKeyNames="idInternal" ShowFooter="true"
    onrowcancelingedit="CancelItem" 
                            onrowediting="EditItem" 
                            OnRowUpdating="UpdateItem" 
                                 ShowHeaderWhenEmpty="true" SkinID="GridView" >
                                 <Columns>
                                 <asp:TemplateField HeaderStyle-Width="350px" HeaderText="Localizacion">
                                         <ItemTemplate>
                                          <asp:Label ID="Label1" runat="server" Text='<%# Eval("etapa")%>' 
                                                 Width="150px"></asp:Label>
                                             <asp:Label ID="localizacionEditTextBox" runat="server" Text='<%# Eval("localizacion")%>' 
                                                 Width="80px"></asp:Label>
                                                 <asp:Label ID="pisoTextBox" runat="server" BackColor="Transparent" 
                                                 Text='<%# Eval("piso")%>'  />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                          <lib:Input ID="etapaTXT" runat="server" BackColor="Transparent" Text='<%# Eval("etapa")%>'
                                                 ReadOnly="true" Width="100px" />
                                             <lib:Input ID="localizacionEditTextBox" runat="server" BackColor="Transparent"  ReadOnly="true"
                                                 Text='<%# Eval("localizacion")%>' Width="80px" />
                                                 <lib:Input ID="pisoTextBox" runat="server" BackColor="Transparent"  ReadOnly="true"
                                                 Text='<%# Eval("piso")%>' Width="80px" />
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                         <lib:Input ID="etapaTXT" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="100px" />
                                             <lib:Input ID="localizacionEditTextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="80px" />
                                                 <lib:Input ID="pisoTextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="80px" />

                                         </FooterTemplate>
                                     </asp:TemplateField>
                                     <asp:TemplateField HeaderStyle-Width="70px" HeaderText="Codigo">
                                         <ItemTemplate>
                                             <asp:Label ID="codigoLabel" runat="server" Text='<%# Eval("codigo")%>' 
                                                 Width="70px"></asp:Label>
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <asp:Label ID="codigoEditTextBox" runat="server" BackColor="Transparent" 
                                                 Text='<%# Eval("codigo")%>'  />
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="codigoEditTextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="70px" />
                                         </FooterTemplate>
                                     </asp:TemplateField>
                                     <asp:TemplateField  HeaderText="Nro Lote /Dpto">
                                         <EditItemTemplate>
                                             <lib:Input ID="descripcionEditTextBox" runat="server" DataType="List"   
                                             Text='<%# Eval("descripcion")%>'
                                               method="GetUI" OnSelect="SelectUI" Width="150"   
                                               ChkVal='<%# int.Parse((string)Request.QueryString["idProyecto"])%>'   ></lib:Input>

                                                 <lib:Input ID="descripcionEdit1TextBox" runat="server" BackColor="Transparent"  
                                                 Text='<%# Eval("descripcion")%>'
                                                 ReadOnly="true" Width="0px" />
                                             <lib:Input ID="idUITXT" runat="server" BackColor="Transparent" 
                                             ReadOnly="true" Text='<%# Eval("idUI")%>'
                                                 Width="0px" />

                                         </EditItemTemplate>
                                         <FooterTemplate>
                                       
                                            <lib:Input ID="descripcionEditTextBox" runat="server" DataType="List" 
                                                 method="GetUI" OnSelect="SelectUI" Width="150"   NumColum="0"
                                                  ChkVal='<%# int.Parse((string)Request.QueryString["idProyecto"])%>'   ></lib:Input>

                                             <lib:Input ID="descripcionEdit1TextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="0px" />
                                             <lib:Input ID="idUITXT" runat="server" BackColor="Transparent" ReadOnly="true" 
                                                 Width="0px" />
                                         </FooterTemplate>
                                         <ItemTemplate>
                                       <asp:Hyperlink runat= "server"  ForeColor="Blue"
                                           Text='<%# DataBinder.Eval(Container.DataItem,"descripcion").ToString()%>'  
                                           Target="_self"  ID="Hyperlink2"
                                            NavigateUrl='<%# "~/VentaAdmin/UI/UIReadForm.aspx?id=" + 
                                            DataBinder.Eval (Container.DataItem,"idUI").ToString()  +
                                            "&idProyecto=" + DataBinder.Eval (Container.DataItem,"idProyecto").ToString()
                                            %>' 
                                           />   
                                             
                                         </ItemTemplate>
                                     </asp:TemplateField>




                                     <asp:TemplateField ControlStyle-Width="120px" HeaderStyle-Width="120px" 
                                         HeaderText="Precio" ItemStyle-HorizontalAlign="Right">
                                         <ItemTemplate>
                                             <asp:Label ID="totalLabel" runat="server" Text='<%# Eval("totalStr")%>' />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                             <lib:Input ID="totalTextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Text='<%# Eval("totalStr")%>' Width="120px"></lib:Input>
                                         </EditItemTemplate>
                                         <FooterTemplate>
                                             <lib:Input ID="totalTextBox" runat="server" BackColor="Transparent" 
                                                 ReadOnly="true" Width="120px"></lib:Input>
                                         </FooterTemplate>
                                     </asp:TemplateField>



                                      <asp:TemplateField ControlStyle-Width="50px" HeaderStyle-Width="50px" 
                                         HeaderText="Separación" ItemStyle-HorizontalAlign="Right">
                                         <ItemTemplate>
                                         
                                             <asp:Label id="separacionLBL"  runat="server" 
                                             Text='<%# Eval("totalSeparacion")%>'  />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                           <lib:Input ID="totalSeparacionTXT" runat="server" DataType="Double" 
                                               Text='<%# Eval("totalSeparacion")%>' Width="80px" />
                                         
                                         </EditItemTemplate>
                                         
                                         <FooterTemplate>
                                            <lib:Input ID="totalSeparacionTXT" runat="server"   DataType="Double"
                                               Width="80px" />
                                            
                                            
                                         </FooterTemplate>
                                     </asp:TemplateField>

                                    
                                       <asp:TemplateField ControlStyle-Width="50px" HeaderStyle-Width="50px" 
                                         HeaderText="Financiado" ItemStyle-HorizontalAlign="Right">
                                         <ItemTemplate>
                                             <input id="bitFinanciadoCHK" type="checkbox" runat="server" 
                                             checked= '<%# Eval("bitFinanciado")%>' disabled="disabled" />
                                         </ItemTemplate>
                                         <EditItemTemplate>
                                         <asp:CheckBox runat="server" ID="bitFinanciadoCHK" 
                                            checked= '<%# Eval("bitFinanciado")%>' />
                                         </EditItemTemplate>
                                         
                                         <FooterTemplate>
                                            <asp:CheckBox runat="server" ID="bitFinanciadoCHK"  />
                                         </FooterTemplate>
                                     </asp:TemplateField>


                                        <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancel.gif" 
                                        EditImageUrl="~/Images/edit.gif" ShowEditButton="true" 
                                        UpdateImageUrl="~/Images/update.gif" />

                                     <asp:TemplateField>
                                         <FooterTemplate>
                                             <asp:Button ID="addProvAdd" runat="server" OnClick="AddItem" Text="Añadir" />

                                             
                                         </FooterTemplate>
                                         <ItemTemplate>
                                             <asp:ImageButton ID="lnkRemove" runat="server" BorderColor="Control" 
                                                 CommandArgument='<%# Eval("idInternal")%>' ImageUrl="~/Images/delete.gif" 
                                                 OnClick="DeleteItem" 
                                                 OnClientClick="return confirm('Usted quiere eliminar?')" />
                                         </ItemTemplate>
                                     </asp:TemplateField>
                                 </Columns>
                             </asp:GridView>

<%--
 <asp:modalpopupextender ID="addItemMPOP" runat="server" 
                                              BackgroundCssClass="modalBackground" 
                                              CancelControlID="cancelarGraficoBTN" dropshadow="True" 
                                              RepositionMode="None"
                                              X="0" Y="0"
                                              DynamicServicePath="" Enabled="True" 
                                              popupcontrolid="graficoParentPanel" 
                                              popupdraghandlecontrolid="graficoPanel" 
                                              targetcontrolid="LinkButton1"/>
                                             
<asp:LinkButton ID="LinkButton1" runat="server"></asp:LinkButton>

      <asp:Panel ID="graficoParentPanel" runat="server"   CssClass="modalPopup">
  <asp:Panel ID="graficoPanel"   runat="server"    
  BorderColor="LightBlue"  BorderStyle="Solid" Style="background-color:#DDDDDD;border:solid 1px Gray;color:Black">
              
        <asp:Panel ID="Panel17" runat="server"   >
        
<table width="100%" >
 <tr  >
               
                <td class=" ms-crm-Dialog-Footer-left">
               
                     <asp:Button ID="aceptarBTN"  runat="server"  Text="Aceptar "  CssClass="ms-crm-List-Header"
                      OnClick="AddGraficoItem"   OnClientClick="return confirm('Seguro que seleccionar la UI?')" 
                       />
                    <asp:Button ID="cancelarGraficoBTN"  runat="server" Text="Cancelar" CssClass="ms-crm-List-Header"
                    
                       
                       />&nbsp;
                   
                </td>
   </tr>


   
</table>
        </asp:Panel> 
 <asp:Panel ID="Panel6" runat="server"  
          class="ms-crm-Dialog-Footer ms-crm-Dialog-Footer-Right">
      <asp:UpdatePanel ID="graficoUPNL" runat="server" UpdateMode="Conditional">
      <ContentTemplate>
            <uc4:ProyectoPanel ID="ProyectoPanel1" runat="server" />
        </ContentTemplate>


      <Triggers>
<%--<asp:AsyncPostBackTrigger ControlID="TabContainer2$recursosTabPanel$eliminarAgrupadoButton" />
<asp:AsyncPostBackTrigger ControlID="cancelarGraficoBTN" />



</Triggers>


      
      </asp:UpdatePanel>

       
  
               
           </asp:Panel>






        </asp:Panel>
          </asp:Panel>
      
--%>